//空格分割字符串,数出分完之后有几个部分
public class Test {
public static int countSegments(String s){
    if(s.length()==0){
        return  0;
    }
    String []ret=s.split(" ");
    int count=0;
    for(String x:ret){
        if(x.length()!=0){
            count++;
        }
    }
    return count;
}

    public static void main(String[] args) {
        System.out.println(countSegments("      ,  ,"));
    }
}
